﻿using DocBot.Objects;

using System;
using System.Collections.Generic;

namespace DocBot.Util.Collections
{
	public class Messenger
	{
		private static object oSyncRoot = new Object();
		private static volatile Messenger _instance = null;

		private Queue<Message> _messages = new Queue<Message>();

		public Queue<Message> Messages
		{
			get { return _messages; }
			set { _messages = value; }
		}

		public static Messenger Instance
		{
			get
			{
				if (_instance == null)
				{
					lock (oSyncRoot)
					{
						_instance = new Messenger();
					}
				}
				return _instance;
			}
		}
	}
}
